//
//  TODetailHeadView.m
//  X-Tribe
//
//  Created by Miss.Ou on 16/4/2.
//  Copyright © 2016年 Miss.Ou. All rights reserved.
//

#import "TODetailHeadView.h"

@interface TODetailHeadView ()

@property(nonatomic,strong)UILabel *titleL;
@property(nonatomic,strong)UILabel *timeL;
@property(nonatomic,strong)UILabel *startTimeL;
@property(nonatomic,strong)UILabel *stopTimeL;
@property(nonatomic,strong)UILabel *autorL;

@end

@implementation TODetailHeadView

-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
        self.backgroundColor = [UIColor yellowColor];
    }
    
    return self;
}

-(void)createSubviews{

    _titleL = [[UILabel alloc] init];
    _titleL.textAlignment = NSTextAlignmentCenter;
    [self addSubview:_titleL];
    [_titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.mas_equalTo(self).offset(5);
        make.height.mas_equalTo(30);
        
    }];
    _titleL.text = @"中国农业学院'最强大脑'校园活动";
    
    _autorL = [[UILabel alloc] init];
    [self addSubview:_autorL];
    _autorL.backgroundColor = WHITE;
    [_autorL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleL.mas_bottom).offset(5);
        make.right.mas_equalTo(self.titleL);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(30);
        
    }];
    _autorL.text = @"发起人 : 小白兔";
    
    _startTimeL = [[UILabel alloc] init];
    [self addSubview:_startTimeL];
    [_startTimeL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleL.mas_bottom).offset(50);
        make.height.mas_equalTo(30);
        make.left.width.mas_equalTo(self.titleL);
        
    }];
    _startTimeL.text = @"发布时间 : 2016.04.14";
    
    _stopTimeL = [[UILabel alloc] init];
    [self addSubview:_stopTimeL];
    [_stopTimeL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.startTimeL.mas_bottom).offset(5);
        make.height.mas_equalTo(30);
        make.width.left.mas_equalTo(self.titleL);
        
    }];
    _stopTimeL.text = @"招募截止时间 : 2016.04.25";
    
    _timeL = [[UILabel alloc] init];
    [self addSubview:_timeL];
    [_timeL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.stopTimeL.mas_bottom).offset(5);
        make.height.mas_equalTo(30);
        make.width.left.mas_equalTo(self.titleL);
        
    }];
    _timeL.text = @"活动起止时间 : 2016.04.25";
    
    
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
